package com.senriot.quickup.service.mapper

import com.senriot.cloud.common.IEntityMapper
import com.senriot.quickup.domain.Ad
import com.senriot.quickup.service.dto.AdDTO

import org.mapstruct.Mapper
import org.mapstruct.Mapping
import org.mapstruct.Mappings
import org.mapstruct.NullValuePropertyMappingStrategy

/**
 * Mapper for the entity [Menu] and its DTO [MenuDTO].
 */
@Mapper(
    componentModel = "spring",
    uses = [],
    nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE
)
abstract class AdMapper : IEntityMapper<AdDTO, Ad> {

    fun fromId(id: String?) = id?.let { Ad().apply { this.id = it } }

    fun getId(ad: Ad) = ad.id
}
